package Xiaofang;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Work04 {
    public static void main(String[] args) {
        try {
            FileReader fileReader=new FileReader("D:\\Xiaofang\\chaoxian.txt");
            BufferedReader br=new BufferedReader(fileReader);
            try {
                int count=0;
                String line=br.readLine();
                long time1=System.nanoTime();
                while (line!=null){
                    line=br.readLine();
                    count++;
                }
                long time2=System.nanoTime();
                long num=time2-time1;
                System.out.println("BufferReader时间："+num+"纳秒");
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
